package h3tcp;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.charset.StandardCharsets;

public class Client {
    public static void main(String[] args) throws IOException {
        //1.创建客户端socket对象
        //2.获取输出流，写数据
        //3.释放资源


        //1.创建客户端socket对象
        Socket s=new Socket("127.0.0.1",9999);

        //2.获取输出流，写数据

        OutputStream os = s.getOutputStream();
        os.write("hello, tcp".getBytes(StandardCharsets.UTF_8));
        //3.释放资源
        s.close();
    }
}
